package com.zhou.springboot;

import com.zhou.springboot.entity.Person;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * author : zhoujb
 * created : 2020/6/26.
 * QQ : 1377072049
 */
@Controller
public class HelloSpringBoot {
    private Logger logger = LoggerFactory.getLogger(HelloSpringBoot.class);
    @RequestMapping("/hello")
    public ModelAndView helloword(Model moedel){
        logger.info("============print");
        ModelAndView mv = new ModelAndView();
        mv.setViewName("hello");
        System.out.println(10/0);
        mv.addObject("bln", "1");
        mv.addObject("msg", new Person("周竞博",23,"测试"));
        return mv;
    }
}
